/***************************************************************************
 *   Copyright (C) 2007 by saa   *
 *   root@saa   *
 ***************************************************************************/

#ifndef DATABASE_H
#define DATABASE_H

#include <QtSql>
#include <QList>
#include <QStringList>

#include "routeserver.h"
#include "singleton.h"


#define DB Database::instance()


class Database : public Singleton<Database>
{
    Q_OBJECT

    friend class Singleton<Database>;

    void log(const QString & message, const LogFlag::LogLevels = LogFlag::Database) const;
    Database() { }

    signals:
        void logDatabaseMessage(const QString & message, const LogFlag::LogLevels LogLevel = LogFlag::Database) const;
    
    public:
        void getRouteServerList(const QString & fileName, QList<RouteServer> * routeServerList) const;
        void saveLinks(const QString & file, const LinkList & linkList) const;
        LinkList getLinkList(const QString & fileName) const;
};

#endif
